package com.wx.controller;

import com.wx.Result.Result;
import com.wx.entity.dto.LoginDto;
import com.wx.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping("/wxLogin")
    @CrossOrigin(origins = "*")
    public Result wxLogin(@RequestBody LoginDto loginDto){
        System.out.println(loginDto.getCode());
        userService.wxLogin(loginDto.getCode());
        return Result.ok();
    }
}
